﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Microsoft.Extensions.DependencyInjection;

namespace XC.Keys.Exrtensions
{ 
    /// <summary>
    /// 应用程序扩展
    /// </summary>
    public static class ApplicationExtension
    {
        /// <summary>
        /// 添加密钥服务
        /// <list type="number">
        /// <item>写注册表密钥管理<see cref="IKeyHelper"/></item>
        /// <item>写文件密钥管理<see cref="ISecretKeyHelper"/></item>
        /// </list>
        /// </summary>
        /// <param name="serviceDescriptors"></param>
        /// <returns></returns>
        public static IServiceCollection AddKeyService(this IServiceCollection serviceDescriptors)
        {
            serviceDescriptors.AddTransient<IKeyHelper, KeyHelper>();
            serviceDescriptors.AddTransient<ISecretKeyHelper, SecretKeyHelper>();
            return serviceDescriptors;
        }
    }
}
